﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;

/// <summary>
/// Summary description for Country
/// </summary>
public class Country
{
  private const string SP = "Country_GetById";
  DatabaseManager db;
  MySqlDataReader reader;

  public string Id { get; set; }
  public string CountryName { get; set; }

  public Country()
  {
    db = new DatabaseManager();
  }

  public void Load(string id)
  {
    db.AddParameter("@id", id);
    using (reader = db.ExecuteStoredProcedure(SP))
    {
      while (reader.Read())
      {
        Id = reader["Country_id"].ToString();
        CountryName = reader["Country"].ToString();
      }
    }
  }
}